#ifndef PIECEMODEL_H_
#define PIECEMODEL_H_

#include "ModelComposite.h"
#include "Position.h"
#include "BlockModel.h"
#include <map>

class PieceModel : public ModelComposite
{
public:
    PieceModel(const Position& position);
    virtual ~PieceModel();

    void move(const Position& delta);
    virtual void rotateCW();
    virtual void rotateCCW();
    virtual void updateClients();
    virtual void reset();

    Positions getBlockPositions();
    Positions getLocalPositions();
    bool collideWith(PieceModel* other);

protected:
    void addBlock(const Position& position);

private:
    BlockModels blocks;
    Position position;
    Position newPosition;
};

typedef std::map<int, PieceModel*> PieceModelsMap;

#endif
